<?php
class HistorialController extends Controller{
	public function actionDetailMatch(){
		$id=$_GET['id'];
		$dao=Dao::Instance();
		$partido=$dao->getDetallePartido($id);
		$params = array('partido'=>$partido);
		echo $this->renderPartial('detailMatch',$params);
	}
	/**
	 * Displays the allTimeSeries page
	 */
	public function actionAllTimeSeries()
	{
		$model=new AllTimeSeriesForm;
		$dao=Dao::Instance();
		$model->listTeam1 = CHtml::listData($dao->getTeamList(),'id_equipo','nombre');
		$model->listTeam2 = $model->listTeam1;
		$model->listLocal = array('1'=>'Equipo1','2'=>'Ambos');
		//$model->dataprovider = $dao->getAllEquipos();
		if(isset($_GET['AllTimeSeriesForm'])){
			$model->attributes=$_GET['AllTimeSeriesForm'];
			if($model->validate()){
				$model->valid=true;
				$model->sintesis = $dao->getSintesis($model->team1, $model->team2, $model->local);
			}
		}
		$params =array(
				'model'=>$model,
		);
	
		if(!isset($_GET["ajax"])) {$this->render('allTimeSeries', $params);}
		else { $model->valid=true;$this->renderPartial('allTimeSeries', $params);}
	}
}